home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9832 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  65 lines

  1. Path: INbe.net!usenet
  2. From: De Ceunynck <pub01228@innet.be>
  3. Newsgroups: comp.lang.c
  4. Subject: Writing to keyboard buffer
  5. Date: 13 Mar 1996 21:47:29 GMT
  6. Organization: INnet NV (post doesn't reflect views of INnet NV)
  7. Message-ID: <4i7fpi$sfv@news.be.innet.net>
  8. NNTP-Posting-Host: pool03-79.innet.be
  9. Mime-Version: 1.0
  10. Content-Type: multipart/mixed;
  11.     boundary="-------------------------------242181555424622"
  12. X-Mailer: Mozilla 1.1 (Windows; I; 16bit)
  13.  
  14. This is a multi-part message in MIME format.
  15.  
  16. ---------------------------------242181555424622
  17. Content-Transfer-Encoding: 7bit
  18. Content-Type: text/plain; charset=us-ascii
  19.  
  20. Hello, I've got a little problem simulating extended keystrokes.
  21.  
  22. The problem is :
  23. To overcome a problem with the Matrox video board in Windows 3.11 I need 
  24. to start a DOS box as a window and then expand it to full screen with 
  25. alt-enter. To do this automatically I intended to write a small C 
  26. program that writes the two-byte scan-code (0 ; 1e) directly in the 
  27. keyboard buffer as if it was typed. 
  28. For some reason it is not possible to write a zero in the buffer. I can 
  29. write and read any other value in the buffer but it won't accept a zero.
  30.  
  31. Does anyone know a solution for this?
  32.  
  33. Kind regards
  34. Herman Currinckx
  35.  
  36. ---------------------------------242181555424622
  37. Content-Transfer-Encoding: 7bit
  38. Content-Type: text/plain
  39.  
  40. #include <stdio.h>
  41. #include <conio.h>
  42. #include <dos.h>
  43.  
  44. void main(void)
  45. {   union REGS regs;
  46.     int c;
  47.  
  48.     clrscr();
  49.     flushall();
  50.     regs.h.ah=5;
  51.     regs.h.cl=0x1c;
  52.     regs.h.ch=0;
  53.     int86(0x16,®s,®s);
  54.     regs.h.ah=5;
  55.     regs.h.cl=28;
  56.     regs.h.ch=0;
  57.     int86(0x16,®s,®s);
  58.     c = getch();
  59.     printf("%d",c);
  60.     c = getch();
  61.     printf(" %d\n",c);
  62.     getch();
  63. }
  64. ---------------------------------242181555424622--
  65.